/**
 * Project Name:framework-webapi
 * File Name:ListResponse.java
 * Package Name:cn.easysw.framework.webapi.domain
 * Date:2015年11月25日下午2:39:23
 * Copyright (c) 2015, www.windo-soft.com All Rights Reserved.
 */

package ink.tiptop.common.domain.rsp;

import ink.tiptop.common.domain.ListBody;

import java.util.List;

/**
 * 2020年08月03日20:09:52 zjf
 */
public class ListResponse<T> extends BodyResponse<ListBody<T>> {

    /**
     * serialVersionUID:TODO(用一句话描述这个变量表示什么).
     *
     * @since JDK 1.6
     */
    private static final long serialVersionUID = 1L;

    /**
     *
     * Creates a new instance of ListResponse.
     *
     * @param body
     */
    public ListResponse(ListBody<T> body) {
        super(body);
    }

    /**
     *
     * Creates a new instance of ListResponse.
     *
     * @param list
     *            列数据
     */
    public ListResponse(List<T> list) {
        super(new ListBody<T>(list));
    }

    /**
     *
     * Creates a new instance of ListResponse.
     *
     * @param list
     *            列数据
     * @param count
     *            列数
     */
    public ListResponse(List<T> list, int count) {
        super(new ListBody<T>(list, count));
    }

    public static <T> ListResponse<T> createEmptyListResponse() {
        ListBody<T> body = new ListBody<T>(null, 0);
        return new ListResponse<T>(body);
    }
}
